package cn.zyjw.mapper;

import cn.zyjw.entity.SysUser;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

public interface SysUserMapper extends BaseMapper<SysUser> {

    @Select("SELECT `id` ,`username`, `password`, `status` FROM sys_user WHERE username = #{userName} ")
    SysUser queryAdminByUserName(String userName);

    @Select("SELECT `code` FROM sys_role LEFT JOIN sys_user_role ON sys_role.id = sys_user_role.role_id WHERE sys_user_role.user_id= #{sysUserId}")
    String queryCodeByUserId(Long sysUserId);
}
